package com.donger.business.config.mybatis;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * MyBatisPlusConfiguration 配置类
 *
 * @author XuYunXuan
 * @date 2019-01-08 19:21
 */
@Configuration
@ConditionalOnBean(DataSource.class)
@MapperScan("com.donger.business.**.mapper")
public class MyBatisPlusConfig {


    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }


}